<?php
if(!$session->check('CurCommittee')){
    if(isset($javascript)):
        // load script in <head> section
        $javascript->link('scriptaculous/lib/prototype', false);
    endif;
}
?>
<div class="meetings form">
    <h2><?php echo __('Edit Meeting').': '.$data['Meeting']['meeting_num'];?></h2>
    <?php echo $form->create('Meeting',array('type'=>'file','url'=>array('committee'=>$dcommittee['Committee']['short_name'])));?>
    <fieldset>
        <legend><?php __('Edit Meeting');?></legend>
        <div class="fieldset-inset">
            <?php
            echo $form->input('id');
            echo $form->input('committee_id', array('type'=>'hidden','value'=>$dcommittee['Committee']['id']));
            echo $form->hidden('parent_id');
            if (isset($data['Notification']) && count($data['Notification'])) $value=1; else $value=0;
            echo $form->hidden('notified',array('value'=>$value));
            echo $form->input('meeting_title');
            echo $form->input('meeting_num');
            echo $datePicker->picker('meeting_date',array('showstime'=>true,'class'=>'required','error'=>__('This field cannot be left blank',true)));
            echo $html->div(
				'input required',
				$form->label('Venue').
				$ajax->autoComplete(
					'venue',
					'/'.$dcommittee['Committee']['short_name'].'/meetings/getvenue',
					array('size'=>50)
				)
			);
            echo $form->error('venue',__('This field cannot be left blank',true),array('class'=>'error-message'));
            echo $form->input('allow_representative',array('label'=>__('Allow representatives',true)));
            echo $form->input('agenda');
            //echo $form->input('setminute',array('type'=>'checkbox','label'=>__('Set Agenda as Minute Paragraph Default Title',true),'onclick' =>"return false "));
            echo $multiFile->input('agenda',array('label'=>__('Agenda Files',true)));
            echo $multiFile->input('minutes',array('label'=>__('Minutes Files',true)));
            echo $multiFile->input('presentations',array('label'=>__('Presentation Files',true)));
            list($ddate,$dtime) = explode(' ', $data['User'][0]['Attendance']['confirm_duedate']);
            echo $datePicker->picker('confirm_duedate',array('label'=>__('Confirm Attendance Deadline',true),'value'=>$ddate));
            
            $days=(Configure::read('days_to_confirm_attendance')>0)?Configure::read('days_to_confirm_attendance'):'0';
            echo "<span class='note'>".__('Leave the field blank will make the deadline become '.$days.' days before meeting date.',true)."</span>";
            ?>
            <fieldset>
                <legend><?php __('Select Members');?></legend>
                <div id="userlist">
                    <?php echo $this->element('userlist',array('users'=>$users,'groups'=>$groups,'from'=>'meetings/edit'));  ?>
                </div>
            </fieldset>
        </div>
    </fieldset>
    <br />
    <?php echo $form->button(__('Save', true),array('type'=>'submit'));?>&nbsp;
    <?php echo $form->button(__('Cancel', true), array('type'=>'button', 'onclick'=>'history.go(-1)'));?>
    <?php echo $form->end();?>
</div>
